﻿using Commons;

namespace Switch
{
    public static class SwitchType
    {
        public static double SwitchMethod(double i, double j, OperatorType operatorType)
        {
            double result = 0;
            switch (operatorType)
            {
                case OperatorType.加:
                    result = i + j;
                    break;
                case OperatorType.减:
                    result = i - j;
                    break;
                case OperatorType.乘:
                    result = i * j;
                    break;
                case OperatorType.除:
                    result = (i * 1.0) / j;
                    break;
                default:
                    break;
            }
            return result;
        }
    }
}
